package alo.p18;

/**
 * @ClassName ShuffleArray
 * @Description 2n数组前n个和后n个交叉
 * @Author Fanxc
 * @DATE 2021/3/14 15:37
 * @Version 1.0
 */
public class ShuffleArray {
    void shuffleArray(int[] A,int l,int r){
        int c=(l+r)/2;
        if (r==1){
            return;
        }
        int temp;
        for (int i=l; i<=c ;i++) {
            temp=A[i];
            A[i]=A[c+i];
            A[c+i]=temp;
        }
        shuffleArray(A,l,c);
        shuffleArray(A,c+1,r);
    }
}
